package problema139;

public class PythagoreanTiles {
	
	public static void main(String[] args){
		System.out.println(pythagoreanTiles());
	}

	public static int pythagoreanTiles(){
		int a, b, c = 334;
		while(c < 1000000){
			for(int i = c - 1; i > 0; i--){
				a = i; b = 1000000 - a - c;
				if(esPythagoreanTriplet(a,b,c)){
					System.out.println(a + " " + b + " " + c);
					//return a*b*c;
				}
			}
			c++;
		}
		return 0;		
	}

	
	public static boolean esPythagoreanTriplet(int a, int b, int c){
		return a * a + b * b == c * c;
	}

}
